package com.deodar.system.service.impl;

import com.deodar.common.annotation.DataSource;
import com.deodar.common.enums.DataSourceType;
import com.deodar.system.domain.PaidInfo;
import com.deodar.system.mapper.PaidInfoMapper;
import com.deodar.system.service.IPaidInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@DataSource(value = DataSourceType.SLAVE)
@Service
public class PaidInfoServiceImpl implements IPaidInfoService {

    @Resource
    private PaidInfoMapper paidInfoMapper;

    @Override
    public List<PaidInfo> findByPripid(String pripid) {
        List<PaidInfo> paidInfos =  paidInfoMapper.selectByPripid(pripid);
        for (PaidInfo info : paidInfos){
            info.setCurrency("156");  // 币种固定人民币万元
        }
        return paidInfos;
    }

    @Override
    public List<PaidInfo> findList(int startNd, int endNd) {
        List<PaidInfo> paidInfos = paidInfoMapper.selectList(startNd, endNd);
        for (PaidInfo info : paidInfos){
            info.setCurrency("156");
        }
        return paidInfos;
    }
}
